import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "../views/Login";
import Student from "@/views/Student";
import UserInfo from "@/components/UserInfo";
import ClassInfo from "@/components/ClassInfo";
import ScoreInfo from "@/components/ScoreInfo";
import Teacher from "../views/Teacher";
import StudentInfo from "../components/StudentInfo";
import ScoreGive from "../components/ScoreGive";
import Admin from "../views/Admin";
import StudentAdmin from "../components/StudentAdmin";
import TeacherAdmin from "../components/TeacherAdmin";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Login
  },
  {
    path: '/student',
    component: Student,
    children:[
      {
        path: '/student/',
        component: UserInfo
      },
      {
        path: '/student/classInfo',
        component: ClassInfo
      },
      {
        path: '/student/scoreInfo',
        component: ScoreInfo
      },
      {
        path: '/student/userInfo',
        component: UserInfo
      }
    ]
  },
  {
    path: '/teacher',
    component: Teacher,
    children: [
      {
        path: '/teacher',
        component: UserInfo
      },
      {
        path: '/teacher/classInfo',
        component: ClassInfo
      },
      {
        path: '/teacher/userInfo',
        component: UserInfo
      },
      {
        path: '/teacher/studentInfo',
        component: StudentInfo
      },
      {
        path: '/teacher/scoreGive',
        component: ScoreGive
      }
    ]
  },
  {
    path: '/admin',
    component: Admin,
    children: [
      {
        path: '/admin/studentAdmin',
        component: StudentAdmin
      },
      {
        path: '/admin/teacherAdmin',
        component: TeacherAdmin
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
